﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TANKWAR_alpha
{
    enum MoveDirection { UP,DOWN,LEFT,RIGHT}
    public static class Constant
    {
        public static int clientWidth = 520;
        public static int clientHeight = 520;
        public static int tankWidth = 40;
        public static int tankHeight = 40;
        public static int bombWidth = 10;
        public static int bombHeight = 10;
       // public static int allBlockWidth = 40;
        //public static int allBlockHeight = 40;
        public static int WallWidth = 20;
        public static int WallHeight = 20;
        public static double BulletSpeed = 10.0 ;
        public static double TankPlayerSpeed = 20;
        public static double TankRobotSpeed = 4;

        public static int ExplodeHitWallSize = 20;
        public static int ExplodexSize = 60;
        public static int GrassSize = 40;
        public static int CanvasUnit = 20;    //the canvas of unit
        public static int BaseSize = 40;
        public static int GuanShu = 5;


        /******judge whether two rectangles have the common intersection **********/
        public static bool RectangleIntersection(double left1,double  top1,int width1,int height1,double left2,double  top2,int width2,int height2)
        {
            bool f1, f2, f3, f4;
            f1=(left1+width1>left2);
            f2=(left2 +width2>left1);
            f3=(top1+height1>top2);
            f4=(top2+height2>top1);

            return f1 && f2 && f3 && f4;
        }

        public static int[][] Map1 = new int[26][]{
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,1,1,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,1,1,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9},
            new int [26]{0,0,9,9,0,0,0,0,9,9,9,9,9,9,9,9,9,9,0,0,0,0,9,9,0,0},
            new int [26]{1,1,9,9,0,0,0,0,9,9,9,9,9,9,9,9,9,9,0,0,0,0,9,9,1,1},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,1,1,9,9,1,1,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9}, 
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9,0,0,9,9,0,0,9,9}, 
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,0,0,0,0,9,9,9,0,0,9,9,0,0,9,9}, 
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,0,4,9,0,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,0,9,9,0,9,9,9,9,9,9,9,9,9,9,9}
        };

        public static int[][] Map2 = new int[26][]{
            new int [26]{9,9,9,9,9,9,1,1,9,9,9,9,9,9,1,1,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,1,1,9,9,9,9,9,9,1,1,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,9,9,1,1,9,9,9,9,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,1,1,9,9,9,9,9,9,0,0,9,9,0,0,9,9,0,0,9,9},
            new int [26]{9,9,0,0,9,9,9,9,9,9,9,9,0,0,0,0,9,9,0,0,1,1,0,0,9,9},
            new int [26]{9,9,0,0,9,9,9,9,9,9,9,9,0,0,0,0,9,9,0,0,1,1,0,0,9,9},
            new int [26]{9,9,9,9,9,9,0,0,9,9,9,9,9,9,9,9,9,9,1,1,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,0,0,9,9,9,9,9,9,9,9,9,9,1,1,9,9,9,9,9,9},//4
            new int [26]{2,2,9,9,9,9,0,0,9,9,9,9,1,1,9,9,0,0,2,2,0,0,9,9,0,0},
            new int [26]{2,2,9,9,9,9,0,0,9,9,9,9,1,1,9,9,0,0,2,2,0,0,9,9,0,0},
            new int [26]{2,2,2,2,9,9,9,9,9,9,0,0,9,9,1,1,9,9,2,2,9,9,9,9,9,9},
            new int [26]{2,2,2,2,9,9,9,9,9,9,0,0,9,9,1,1,9,9,2,2,9,9,9,9,9,9},
            new int [26]{9,9,0,0,0,0,0,0,2,2,2,2,2,2,9,9,9,9,2,2,0,0,0,0,9,9},
            new int [26]{9,9,0,0,0,0,0,0,2,2,2,2,2,2,9,9,9,9,2,2,0,0,0,0,9,9},
            new int [26]{9,9,9,9,9,9,1,1,2,2,0,0,9,9,9,9,0,0,9,9,0,0,0,0,9,9},
            new int [26]{9,9,9,9,9,9,1,1,2,2,0,0,9,9,9,9,0,0,9,9,0,0,0,0,9,9},
            new int [26]{1,1,0,0,9,9,1,1,9,9,0,0,9,9,9,9,9,9,9,9,0,0,0,0,9,9},
            new int [26]{1,1,0,0,9,9,1,1,9,9,0,0,9,9,9,9,9,9,9,9,0,0,0,0,9,9}, //11
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,9,9,0,0,1,1,0,0,0,0,9,9}, 
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,9,9,0,0,1,1,0,0,0,0,9,9}, 
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,0,0,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,9,9,9,9,9,9,0,0,0,0,9,9,0,0,9,9,0,0,9,9,9,9},
            new int [26]{9,9,0,0,9,9,9,9,9,9,0,0,0,0,0,0,0,0,9,9,0,0,9,9,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,4,9,0,0,9,9,0,0,0,0,0,0,9,9},
            new int [26]{9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,9,9,0,0,0,0,0,0,9,9}
        };

        public static int[][] Map3 = new int[26][]{
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,3,3,3,9,9,2,9,9,2,2,2,2,9,9,9,2,2,2,2,2,9,9,9,9},
            new int [26]{9,9,9,3,9,9,9,2,9,9,2,9,2,2,9,9,9,2,2,9,9,9,9,9,9,9},
            new int [26]{9,9,9,3,9,9,9,2,9,9,2,9,2,9,2,9,2,9,2,2,2,2,9,9,9,9},
            new int [26]{9,9,9,3,9,9,9,2,9,9,2,9,2,9,2,9,2,9,2,9,9,9,9,9,9,9},
            new int [26]{9,9,3,3,3,9,9,2,2,2,2,2,2,9,9,2,9,9,2,2,2,2,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,0,9,0,9,0,0,0,9,0,9,9,0,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,0,9,0,9,0,9,0,9,0,9,9,0,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,0,0,0,9,0,9,0,9,0,9,9,0,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,0,9,0,9,0,9,0,9,9,0,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,0,0,0,9,0,0,0,9,0,0,0,0,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,0,0,0,9,0,0,0,0,9,0,0,9,9,9,0,9,9,0,0,9,0,0,9,9},
            new int [26]{9,9,0,9,9,9,0,9,9,9,9,0,9,0,9,9,0,9,0,9,9,0,9,9,0,9},
            new int [26]{9,9,0,0,0,9,0,0,0,0,9,0,9,9,0,9,0,9,9,9,9,0,9,9,9,9},
            new int [26]{9,9,9,9,0,9,0,9,9,9,9,0,9,9,0,9,0,9,9,0,9,9,9,0,9,9},
            new int [26]{9,9,0,0,0,9,0,0,0,0,9,0,9,9,9,0,0,9,9,9,0,0,0,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
            new int [26]{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
        };
        //public static object[] MAP = { Map1, Map2 };
        public static int[][][] map = new int[3][][] {Map1, Map2,Map3};
    }
}
